from dataaccess import RatingData
from common import utility


class RatingBiz(object):
    def __init__(self):
        pass

    def __ValidateInsert(self, rating):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def __ValidateUpdate(self, rating):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")

    def __ValidateDelete(self, memberID,songID):
        valid = True
        if not valid:
            raise utility.BusinessException(message="",fieldName = "")
        
    def InsertRating(self, rating):
        self.__ValidateInsert(rating)
        ratingData = RatingData.RatingData()
        ratingData.InsertRating(rating)

    def UpdateRating(self, rating):
        self.__ValidateUpdate(rating)
        ratingData = RatingData.RatingData()
        ratingData.UpdateRating(rating)

    def DeleteRating(self, memberID,songID):
        self.__ValidateDelete(memberID,songID)
        ratingData = RatingData.RatingData()
        ratingData.DeleteRating(memberID,songID)
